@import './variables.less';
@import './mixins.less';

// Global Styles
* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: @font-family;
  font-size: @font-size-base;
  line-height: 1.6;
  color: @gray-800;
  background: @gray-50;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

// Typography
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 @spacing-md 0;
  font-weight: 600;
  line-height: 1.3;
  color: @gray-900;
}

h1 {
  font-size: @font-size-3xl;
}
h2 {
  font-size: @font-size-2xl;
}
h3 {
  font-size: @font-size-xl;
}
h4 {
  font-size: @font-size-lg;
}
h5 {
  font-size: @font-size-base;
}
h6 {
  font-size: @font-size-sm;
}

p {
  margin: 0 0 @spacing-md 0;
  color: @gray-700;
}

a {
  color: @primary-600;
  text-decoration: none;
  transition: color @transition-fast;

  &:hover {
    color: @primary-700;
  }
}

// Lists
ul,
ol {
  margin: 0 0 @spacing-md 0;
  padding-left: @spacing-lg;
}

li {
  margin-bottom: @spacing-xs;
}

// Code
code {
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 0.875em;
  background: @gray-100;
  padding: 2px 6px;
  border-radius: 4px;
  color: @gray-800;
}

pre {
  background: @gray-900;
  color: @gray-100;
  padding: @spacing-md;
  border-radius: @border-radius;
  overflow-x: auto;
  font-size: @font-size-sm;

  code {
    background: transparent;
    padding: 0;
    color: inherit;
  }
}

// Tables
table {
  width: 100%;
  border-collapse: collapse;
  margin: @spacing-md 0;
}

th,
td {
  padding: @spacing-sm @spacing-md;
  text-align: left;
  border-bottom: 1px solid @gray-200;
}

th {
  background: @gray-50;
  font-weight: 600;
  color: @gray-900;
}

// Forms
input,
textarea,
select {
  .input-base();
}

label {
  display: block;
  margin-bottom: @spacing-xs;
  font-weight: 500;
  color: @gray-700;
}

// Buttons
button {
  .button-base();
}

// Utilities
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid @gray-300;
  border-radius: 50%;
  border-top-color: @primary-600;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

// Focus styles for accessibility
*:focus-visible {
  outline: 2px solid @primary-500;
  outline-offset: 2px;
}

// Selection styles
::selection {
  background: fade(@primary-600, 20%);
  color: @gray-900;
}

// Responsive breakpoints
@media (max-width: 768px) {
  body {
    font-size: @font-size-sm;
  }

  .container {
    padding: 0 @spacing-sm;
  }
}
